import request from '@/utils/request'

// 查询客户历史记录列表
export function listCustomerHistory(query) {
  return request({
    url: '/wms/customerHistory/list',
    method: 'get',
    params: query
  })
}

// 查询客户历史记录详细
export function getCustomerHistory(id) {
  return request({
    url: '/wms/customerHistory/' + id,
    method: 'get'
  })
}

// 根据商户ID查询历史记录
export function getHistoryByMerchantId(merchantId) {
  return request({
    url: '/wms/customerHistory/merchant/' + merchantId,
    method: 'get'
  })
}

// 根据商品ID查询历史记录
export function getHistoryByItemId(itemId) {
  return request({
    url: '/wms/customerHistory/item/' + itemId,
    method: 'get'
  })
}

// 根据SKU ID查询历史记录
export function getHistoryBySkuId(skuId) {
  return request({
    url: '/wms/customerHistory/sku/' + skuId,
    method: 'get'
  })
}

// 新增客户历史记录
export function addCustomerHistory(data) {
  return request({
    url: '/wms/customerHistory',
    method: 'post',
    data: data
  })
}

// 修改客户历史记录
export function updateCustomerHistory(data) {
  return request({
    url: '/wms/customerHistory',
    method: 'put',
    data: data
  })
}

// 删除客户历史记录
export function delCustomerHistory(id) {
  return request({
    url: '/wms/customerHistory/' + id,
    method: 'delete'
  })
} 